import service from "@/utils/request.ts";
import {COMPLETE_PRE} from '@/api/port-info.ts'

/**
 * 获取用户信息列表
 * @param params 参数
 */
export async function getMainDictListReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/getList',
        method: 'POST',
        data: params
    });
}

/**
 * 保存主字典信息
 * @param params 参数
 */
export async function saveMainDictReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/saveItem',
        method: 'POST',
        data: params
    });
}

/**
 * 刷新字典缓存
 * @param params 参数
 */
export async function refreshDictRedisReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/refreshDict',
        method: 'POST',
        data: params
    });
}

/**
 * 删除字典信息
 * @param params 参数
 */
export async function delMainDictReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/deleteItem',
        method: 'POST',
        data: params
    });
}

/**
 * 获取字典明细信息
 * @param params 参数
 */
export async function getDetailDictReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/getDetailList',
        method: 'POST',
        data: params
    });
}

/**
 * 保存字典明细信息
 * @param params 参数
 */
export async function saveDetailDictReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/saveDetailItem',
        method: 'POST',
        data: params
    });
}

/**
 * 删除字典明细信息
 * @param params 参数
 */
export async function delDetailDictReq(params: any) {
    return service({
        baseURL: COMPLETE_PRE,
        url: 'admin/dict/deleteDetailItem',
        method: 'POST',
        data: params
    });
}